<template>
    <div>
        <component :is="component" :businessId="businessId" v-if="component" @cancelMsg="cancelMsg"/>
    </div>
</template>

<script>
    
export default {
    props: {
        link: String
    },
    data() {
        return {
            // 组件
            component: null,
            businessId: '',
            loading: false,
        }
    },
    mounted() {
        if (this.link) {
            var arrays = this.link.split("?");
            this.component = (resolve) => require(['@/views' + arrays[0]], resolve);
            this.businessId = arrays.length > 1 ? arrays[1] : "";
        }
        
    },
    methods: {
        cancelMsg() {
            this.$emit('cancelMsg')
        }
    }
}

</script>